package cn.guoxuepeng.hrm.client;

import cn.guoxuepeng.hrm.client.impl.CourseElasticsearchClientImpl;
import cn.guoxuepeng.hrm.domain.CourseAddES;
import cn.guoxuepeng.hrm.domain.CourseByKeyVo;
import cn.guoxuepeng.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name="elasticsearch-service",fallback = CourseElasticsearchClientImpl.class)
public interface CourseElasticsearchClient {

    /**
     * 添加课程到es中
     * @param list
     * @return
     */
    @PostMapping("/addBatch")
    AjaxResult add(@RequestBody List<CourseAddES> list);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    @PostMapping("/deleteBatch")
    AjaxResult delete(@RequestBody List<Long> ids);

    /**
     * 根据关键字查询课程并返回
     * @param courseByKeyVo
     * @return
     */
    @PostMapping("/findCourseByKey")
    public AjaxResult findCourseByKey(@RequestBody CourseByKeyVo courseByKeyVo);

}
